package com.lczyfz.campusinfo.modules.alipay.config;

import com.google.common.collect.Maps;
import com.lczyfz.campusinfo.common.utils.PropertiesLoader;
import com.lczyfz.campusinfo.common.utils.StringUtils;

import java.util.Map;

/**
 *创建人:陈文
 *创建时间:2017年8月15日 下午5:06:13
 *备注:
 */
public class AlipayConfig {
	
	/**
	 * 保存全局属性值
	 */
	private static Map<String, String> map = Maps.newHashMap();
	
	/**
	 * 属性文件加载对象
	 */
    private static PropertiesLoader loader = new PropertiesLoader("alipay.properties");
	/**
	 * 获取配置
	 * @see ${fns:getConfig('adminPath')}
	 */
	public static String getConfig(String key) {
		String value = map.get(key);
		if (value == null){
			value = loader.getProperty(key);
			map.put(key, value != null ? value : StringUtils.EMPTY);
		}
		return value;
	}
    public static String getAppId(){
    	return getConfig("H5.APPID");
    }
    
    public static String getRsaPrivateKey(){
    	return getConfig("H5.RSA_PRIVATE_KEY");
    }
    
    public static String getNotifyUrl(){
    	return getConfig("H5.NOTIFY_URL");
    }
    public static String getReturnUrl(){
    	return getConfig("H5.RETURN_URL");
    }
    public static String getUrl(){
    	return getConfig("H5.URL");
    }
    public static String getCharset(){
    	return getConfig("H5.CHARSET");
    }
    public static String getFormat(){
    	return getConfig("H5.FORMAT");
    }
    public static String getAlipayPublicKey(){
    	return getConfig("H5.ALIPAY_PUBLIC_KEY");
    }
    public static String getSigntype(){
    	return getConfig("H5.SIGNTYPE");
    }
/*	// 商户appid
	public static String APPID = "2017081408191275";
	// 私钥 pkcs8格式的
	public static String RSA_PRIVATE_KEY = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDTCKdIWmt7oH5xfTPMolYkF0SRzFpYbT2egGlj97AMDMzZcMfFmRYEY489LMigNEhZL2lMhbkVVjEB97dSt4bPnWJFyyMsmNcXk8k6TgasZlKJpPv5elcUI3/rXJmPzoiipBRF8PfdDR4Dt+H4g0z7qUONfdtpjLfUiLna1fpzAWhvkPp9Xz6T9j9TBpZvxxwmN7wpveg/671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/uuik40ohNrqMJ/T9Nl3KRYj6MFcMeU0aAyJMp7OLYIkCabjUaEZt/t3UDolPdv/UuTMSg20kySjGXyJ9ynnldBB1v360AK6bHyjs5BWOjf5G7pcLszG10CA0pWUQ1AoGBAJGJjqrgaD5sd7bHroVhnQxnEQkqKx2qDQWnEqK0zv0bQvQkelKz4GVx1aI867TrulBmG2LZDJwnEmO/uXb8D7jT0TOxtP0cufGY+2PEhKWRrFkWPmHUhBm0BihqtelHNgiiozJroJVaiIjXxU88969XJu+aA+Dd+/T5Bp0aACoY";
	// 服务器异步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String NOTIFY_URL = "https://card.fjut.edu.cn/alipay/notify_url";
	// 页面跳转同步通知页面路径 需http://或者https://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问 商户可以自定义同步跳转地址
	public static String RETURN_URL = "https://card.fjut.edu.cn/alipay/return_url";
	// 请求网关地址
	public static String URL = "https://openapi.alipay.com/gateway.do";
	// 编码
	public static String CHARSET = "UTF-8";
	// 返回格式
	public static String FORMAT = "json";
	// 支付宝公钥
	public static String ALIPAY_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAkl8PPlM2U2DA/TEiWiSOGaE59wQAi5NkApDyHt/6lkh08SzIQFBN19oqDE4+2u6jRBbrpbPgOjs6IuC21X4jQgiRwuXLQ7CJXQV7axtupGwnr6lleFXbSMv2tT8rW3NDiSH4Zin44QinkSxuwTqjzb6BaGxKbyCoxiukf8QaJiGT9PZAq0gL0mexHW1XQCsx6p8ywLeXQUhYO4HVAaMWFZtXjDEioaHKytqE5OrgPRG5PF38vwS1eaeFGoXlTH0cDmJwK1zjgOw1JjWC16RqsaLva0/Gu/fsdxSCaZ5VAGvkh2FopEuUY2Jc1/z852cOs+2sJPfysQ5Qd4012jnqkQIDAQAB";
	// 日志记录目录
	public static String log_path = "/log";
	// RSA2
	public static String SIGNTYPE = "RSA2";
	//合作者身份ID
	public static String PARTNER ="2088721563718495";
	//收款支付宝账号 ，一般情况下收款账号就是签约账号，使用partner即可
	public static String SELLER_ID="2088721563718495";*/
//微信账号
	public static String getWxAppId(){
		return getConfig("WX.APPID");
	}
	public static String getWxMachId(){
		return getConfig("WX.MACHID");
	}
	public static String getWXFEETYPE(){
		return getConfig("WX.FEETYPE");
	}
	public static String getWXnotiyurl(){
		return getConfig("WX.NOTIFYURL");
	}
	public static String getWXsingType(){
		return getConfig("WX.SINGTYPE");
	}
	public static String getWXkey(){
		return getConfig("WX.KEY");
	}
	public static String getSBkey(){
		return getConfig("WX.SBKEY");
	}
	public static String getOrderhttp(){
		return getConfig("WX.ORDER");
	}
	public static String getSBOderhttp(){
		return getConfig("WX.SBORDER");
	}
}
